package com.myproject.shop.service.impl;

import com.myproject.shop.domain.Goods;
import com.myproject.shop.mapper.GoodsMapper;
import com.myproject.shop.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GoodsServiceImpl implements IGoodsService {





    @Autowired
        private GoodsMapper goodsMapper;

        @Override
        public List<Goods> selectAllGoods() {
            return goodsMapper.selectAllGoods();
        }

        @Override
        public List<Goods> selectGoodsByParam(String goodsName) {
            return goodsMapper.selectGoodsByParam(goodsName);
        }
    @Override
        public Goods selectGoodsById(Integer gid)
        {return goodsMapper.selectGoodsById(gid);}
        @Override
        public int insertGoods(Goods goods) {
            return goodsMapper.insertGoods(goods);
        }

        @Override
        public int updateGoods(Goods goods) {
            return goodsMapper.updateGoods(goods);
        }

        @Override
        public int deleteGoodsById(Integer gid) {
            return goodsMapper.deleteGoodsById(gid);
        }

}
